home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / AmiVoGL_MDEV.lha / examples / trivial.c < prev    next >
C/C++ Source or Header  |  1994-07-15  |  1KB  |  52 lines

  1. #include <stdio.h>
  2.  
  3. #ifdef SGI
  4. #include "gl.h"
  5. #include "device.h"
  6. #include "hershey.h"
  7. #else
  8. #include "vogl.h"
  9. #include "vodevice.h"
  10. #endif
  11.  
  12. /*
  13.  * the basic test program for a driver if we can draw a line and do
  14.  * hardware text we are almost there!
  15.  */
  16. int main(
  17.   int argc,
  18.   char **argv)
  19. {
  20.     short    val;
  21.  
  22.     winopen("trivial");
  23.  
  24.     if (argc == 2)
  25.         font(atoi(argv[1]));        /* set font to argument */
  26.  
  27.     qdevice(KEYBD);            /* enable the keyboard */
  28.     unqdevice(INPUTCHANGE);
  29.  
  30.     color(BLACK);            /* we want to clear in black */
  31.     clear();            /* clear to current color */
  32.  
  33.     ortho2(-1.0, 1.0, -1.0, 1.0);    /* set up the coordinate system */
  34.  
  35.     color(GREEN);            /* set current color to green */
  36.  
  37.     move2(-1.0, 0.0);        /* draw a horizontal line at y = 0 */
  38.     draw2(1.0, 0.0);
  39.  
  40.     qread(&val);            /* pause for some input */
  41.  
  42.     move2(0.0, 0.0);        /* draw a line along x = 0 */
  43.     draw2(0.0, 1.0);
  44.  
  45.     cmov2(0.0, 0.0);        /* move to the middle of the screen */
  46.     charstr("Hello");        /* draw "Hello" starting at the origin */
  47.  
  48.     qread(&val);            /* pause again */
  49.  
  50.     gexit();            /* set screen back to original state */
  51. }
  52.